//创建单据并关联附件(datatable_id创建单据数据源id,fields创建单据字段[{"field":XXX,"value":XXX}],files附件id数组)
function wj_cjdjbglfj(steps,jobname,datatable_id,fields,files){
    var step=  {
      "step_name": jobname,
      "opt_type": 1,
      "datatable_id": datatable_id,
      "args": "",
      "field_params": []
    }
    //生成单据字段
    fields.forEach(item => {
      step.field_params.push({
        "value_from": item.value_from,
        "field": item.field,
        "value": item.value,
        "data_type": 1
      })
    });
    steps.push(step);
    //更新附件父级id
    files.forEach((item,index) => {
      steps.push(		{
              "step_name": jobname+"_更新附件父级id"+index,
              "opt_type": 4,
              "datatable_id": "1893459279503953920",
              "args": item.data_id,
              "args_from": 1,
              "field_params": [
                  {
                      "value_from": 2,
                      "field": "form_data_id",
                      "value": jobname,
                      "data_type": 1
                  }
              ]
          })
    });
    return steps
  }
  //文件关联单据(dataId单据id，files文件数组)
  function wj_wjgldj(steps,jobname,dataId,files){
    files.forEach((item,index) => {
      steps.push(		{
              "step_name": jobname+"_更新附件父级id"+index,
              "opt_type": 4,
              "datatable_id": "1893459279503953920",
              "args": item.data_id,
        "args_from": 1,
              "field_params": [
                  {
                      "value_from": 1,
                      "field": "form_data_id",
                      "value": dataId,
                      "data_type": 1
                  }
              ]
          })
    });
    return steps
  }